import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:laoba_menu/views/product-detail/Detail.dart';

class MaterialItem extends StatefulWidget {
  MaterialItem({Key key, this.name, this.number, this.id, this.cook_id})
      : super(key: key);

  final String name;
  final String number;
  final int id;
  final int cook_id;
  @override
  MaterialItemWState createState() =>
      new MaterialItemWState(this.name, this.number, this.id, this.cook_id);
}

class MaterialItemWState extends State<MaterialItem> {
  String name;
  final String number;
  final int id;
  int cook_id;
  MaterialItemWState(this.name, this.number, this.id, this.cook_id);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.all(0),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Container(
            margin: const EdgeInsets.fromLTRB(20, 10, 20, 10),
            child: Text(
              "${name}",
              style: TextStyle(color: Colors.black87),
            ),
          ),
          Container(
            padding: const EdgeInsets.fromLTRB(0, 10, 20, 10),
            child: Text(
              "${number}",
              style: TextStyle(color: Colors.black87),
            ),
          )
        ],
      ),
    );
  }
}
